package com.ftg.learn.bus.deptexam.controller;

import com.ftg.learn.bus.deptexam.entity.DeptExam;
import com.ftg.learn.bus.deptexam.service.DeptExamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@Api(value = "管理部门审批",tags = "管理部门审批")
public class DeptExamController {

    @Autowired
    DeptExamService des;

    @ApiOperation(value = "查看审批")
    @GetMapping("/showexam")
    public List<Map<String,Object>> showAll(){
        return des.showAll();
    }

    @ApiOperation(value = "查一条审批")
    @PutMapping("/findOnexam/{deptexam_id}")
    public List<Map<String,Object>> findOne(@ApiParam("审批id") @PathVariable String deptexam_id){
        return des.findOne(deptexam_id);
    }

    @ApiOperation(value = "审批")
    @PostMapping("/updatecs/{expendcar_id}/{check_state}/{deptexam_id}")
    public int update(@ApiParam("审核id") @PathVariable String deptexam_id,@ApiParam("公车经费支出登记id") @PathVariable String expendcar_id,@ApiParam("审核状态") @PathVariable String check_state){
        return des.update(expendcar_id,check_state,deptexam_id);
    }
}
